/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ProblemAddRequest } from '../models/ProblemAddRequest';
import type { ProblemEditRequest } from '../models/ProblemEditRequest';
import type { ProblemQueryRequest } from '../models/ProblemQueryRequest';
import type { ProblemUpdateRequest } from '../models/ProblemUpdateRequest';
import type { RBoolean } from '../models/RBoolean';
import type { RListString } from '../models/RListString';
import type { RLong } from '../models/RLong';
import type { RPageProblemVo } from '../models/RPageProblemVo';
import type { RPageSafeProblemVo } from '../models/RPageSafeProblemVo';
import type { RProblemVo } from '../models/RProblemVo';
import type { RSafeProblemVo } from '../models/RSafeProblemVo';
import type { RString } from '../models/RString';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class ProblemControllerService {

    /**
     * @param requestBody
     * @returns RBoolean OK
     * @throws ApiError
     */
    public static updateProblem(
        requestBody: ProblemUpdateRequest,
    ): CancelablePromise<RBoolean> {
        return __request(OpenAPI, {
            method: 'PUT',
            url: '/oj/problem',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RLong OK
     * @throws ApiError
     */
    public static addQuestion(
        requestBody: ProblemAddRequest,
    ): CancelablePromise<RLong> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/oj/problem',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RPageProblemVo OK
     * @throws ApiError
     */
    public static listProblemVoByPage(
        requestBody: ProblemQueryRequest,
    ): CancelablePromise<RPageProblemVo> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/oj/problem/page/vo',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RPageSafeProblemVo OK
     * @throws ApiError
     */
    public static listSafeProblemVoByPage(
        requestBody: ProblemQueryRequest,
    ): CancelablePromise<RPageSafeProblemVo> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/oj/problem/page/vo/safe',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static editQuestion(
        requestBody: ProblemEditRequest,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/oj/problem/edit',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param id
     * @returns RProblemVo OK
     * @throws ApiError
     */
    public static getProblemVoById(
        id: number,
    ): CancelablePromise<RProblemVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/oj/problem/{id}/vo',
            path: {
                'id': id,
            },
        });
    }

    /**
     * @param id
     * @returns RSafeProblemVo OK
     * @throws ApiError
     */
    public static getSafeProblemVoById(
        id: number,
    ): CancelablePromise<RSafeProblemVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/oj/problem/{id}/vo/safe',
            path: {
                'id': id,
            },
        });
    }

    /**
     * @returns RListString OK
     * @throws ApiError
     */
    public static getProblemTags(): CancelablePromise<RListString> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/oj/problem/tags',
        });
    }

    /**
     * @param id
     * @returns RBoolean OK
     * @throws ApiError
     */
    public static deleteProblem(
        id: number,
    ): CancelablePromise<RBoolean> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/oj/problem/{id}',
            path: {
                'id': id,
            },
        });
    }

}
